﻿using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using MebAppMarketplace.Biz;
using MebAppMarketplace.Model;

namespace MebAppMarketplace.Biz.Migrations
{
    [DbContext(typeof(ApplicationDatabase))]
    partial class ApplicationDatabaseModelSnapshot : ModelSnapshot
    {
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
            modelBuilder
                .HasAnnotation("ProductVersion", "1.1.2")
                .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

            modelBuilder.Entity("MebAppMarketplace.Model.App", b =>
                {
                    b.Property<Guid>("ID")
                        .ValueGeneratedOnAdd();

                    b.Property<string>("CategoryPath");

                    b.Property<bool>("CategoryRecommend");

                    b.Property<string>("Description");

                    b.Property<bool>("Enabled");

                    b.Property<bool>("HomeRecommend");

                    b.Property<byte[]>("Icon");

                    b.Property<bool>("IsOfficalApp");

                    b.Property<string>("Location");

                    b.Property<string>("Manufacturer");

                    b.Property<int>("NDownload");

                    b.Property<string>("Name");

                    b.Property<string>("NewApp");

                    b.Property<DateTime>("OLTime");

                    b.Property<Guid>("OwnerID");

                    b.Property<int>("Price");

                    b.Property<string>("Publisher");

                    b.Property<int>("Version");

                    b.HasKey("ID");

                    b.ToTable("Apps");
                });

            modelBuilder.Entity("MebAppMarketplace.Model.AppBase", b =>
                {
                    b.Property<Guid>("ID")
                        .ValueGeneratedOnAdd();

                    b.Property<string>("AppJson");

                    b.Property<DateTime>("CreateTime");

                    b.Property<DateTime?>("DeleteTime");

                    b.Property<bool>("Deleted");

                    b.Property<string>("Description");

                    b.Property<bool>("IsOffShelve");

                    b.Property<string>("Manufacturer");

                    b.Property<string>("Name");

                    b.Property<string>("OffShelveReason");

                    b.Property<Guid>("OwnerID");

                    b.Property<string>("Publisher");

                    b.Property<int?>("Version");

                    b.HasKey("ID");

                    b.ToTable("AppBases");
                });

            modelBuilder.Entity("MebAppMarketplace.Model.AppEvent", b =>
                {
                    b.Property<Guid>("ID")
                        .ValueGeneratedOnAdd();

                    b.Property<string>("AppName");

                    b.Property<string>("AppVersion");

                    b.Property<string>("Channel");

                    b.Property<string>("Content");

                    b.Property<DateTime>("CreateTime");

                    b.Property<string>("DeviceBrand");

                    b.Property<string>("DeviceID");

                    b.Property<string>("DeviceModel");

                    b.Property<DateTime>("EventTime");

                    b.Property<string>("Name");

                    b.Property<string>("Os");

                    b.Property<string>("PrevEvent");

                    b.Property<string>("StackTrace");

                    b.Property<string>("UserID");

                    b.Property<string>("UserSID");

                    b.HasKey("ID");

                    b.ToTable("MebAppMarketplace");
                });

            modelBuilder.Entity("MebAppMarketplace.Model.AppVersion", b =>
                {
                    b.Property<Guid>("ID")
                        .ValueGeneratedOnAdd();

                    b.Property<Guid>("AppID");

                    b.Property<string>("Description");

                    b.Property<bool>("Enabled");

                    b.Property<byte[]>("Icon");

                    b.Property<string>("Location");

                    b.Property<string>("Manufacturer");

                    b.Property<int>("NDownload");

                    b.Property<string>("Name");

                    b.Property<DateTime>("OLTime");

                    b.Property<int>("Price");

                    b.Property<int>("Version");

                    b.HasKey("ID");

                    b.ToTable("AppVersions");
                });

            modelBuilder.Entity("MebAppMarketplace.Model.Developer", b =>
                {
                    b.Property<Guid>("ID")
                        .ValueGeneratedOnAdd();

                    b.Property<DateTime>("CreateTime");

                    b.Property<string>("Email");

                    b.Property<bool>("IsCertificated");

                    b.Property<string>("Name");

                    b.HasKey("ID");

                    b.ToTable("Developers");
                });

            modelBuilder.Entity("MebAppMarketplace.Model.User", b =>
                {
                    b.Property<Guid>("ID")
                        .ValueGeneratedOnAdd();

                    b.Property<DateTime>("CreateTime");

                    b.Property<string>("Email");

                    b.Property<bool>("Enabled");

                    b.Property<DateTime?>("LastLoginAt");

                    b.Property<string>("LastLoginIp");

                    b.Property<string>("LastLoginMachine");

                    b.Property<string>("Password");

                    b.Property<string>("RealName");

                    b.Property<string>("Roles");

                    b.Property<string>("UserName");

                    b.HasKey("ID");

                    b.ToTable("AppUsers");
                });

            modelBuilder.Entity("MebAppMarketplace.Model.UserApp", b =>
                {
                    b.Property<Guid>("ID")
                        .ValueGeneratedOnAdd();

                    b.Property<Guid>("AppID");

                    b.Property<DateTime>("CreateTime");

                    b.Property<DateTime?>("FirstRunTime");

                    b.Property<bool>("IsDelete");

                    b.Property<DateTime?>("LastRunTime");

                    b.Property<int>("NAppRuns");

                    b.Property<int>("NCorRuns");

                    b.Property<Guid>("UserID");

                    b.HasKey("ID");

                    b.ToTable("UserApps");
                });

            modelBuilder.Entity("MebAppMarketplace.Model.UserRegistrationRequest", b =>
                {
                    b.Property<Guid>("ID")
                        .ValueGeneratedOnAdd();

                    b.Property<int>("AuditState");

                    b.Property<DateTime?>("AuditTime");

                    b.Property<DateTime>("CreateTime");

                    b.Property<string>("Email");

                    b.Property<string>("Message");

                    b.Property<string>("RealName");

                    b.Property<string>("RejectReason");

                    b.HasKey("ID");

                    b.ToTable("UserRegistrationRequest");
                });

            modelBuilder.Entity("MebAppMarketplace.Model.UserWallet", b =>
                {
                    b.Property<Guid>("ID")
                        .ValueGeneratedOnAdd();

                    b.Property<int>("Banlance");

                    b.Property<string>("LockReason");

                    b.Property<DateTime>("LockTime");

                    b.Property<bool>("Locked");

                    b.HasKey("ID");

                    b.ToTable("UserWallet");
                });

            modelBuilder.Entity("MebAppMarketplace.Model.UserWalletHistory", b =>
                {
                    b.Property<Guid>("ID")
                        .ValueGeneratedOnAdd();

                    b.Property<int>("Changes");

                    b.Property<DateTime>("CreateTime");

                    b.Property<int>("LBanlance");

                    b.Property<string>("OpDetail");

                    b.Property<string>("OpName");

                    b.Property<int>("RBanlance");

                    b.Property<int>("UserID");

                    b.HasKey("ID");

                    b.ToTable("UserWalletHistories");
                });
        }
    }
}
